package top.stmo.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.*;
import top.stmo.pojo.User;

import java.util.Arrays;

@RestController
@RequestMapping("/books")
public class BooksController {

//    @Value("${book}")           //读取配置文件中数据
//    private String book;
//
//    @Value("${ent.sub}")        //读取配置文件中数组
//    private String[] sub;
//
//    @Autowired
//    private Environment environment;
//
//    @Autowired
//    private User user;


    @GetMapping("/{id}")
    public String getById(@PathVariable Integer id) {
        System.out.println("id：" + id);
//        System.out.println(book);
//        System.out.println(Arrays.toString(sub));
//        System.out.println("-------------------");
//        System.out.println(environment.getProperty("book"));
//        System.out.println(environment.getProperty("ent.name"));
//        System.out.println(environment.getProperty("ent.sub"));
//        System.out.println(user);
        return "id：" + id;
    }

}
